<?php

namespace App\Http\Controllers;

use App\Exceptions\ValidationException;
use App\Http\Controllers\BaseController;
use App\Services\GovernmentInfoService;

class GovernmentInfoController extends BaseController
{
    public function __construct(GovernmentInfoService $governmentInfoService)
    {

        $this->governmentInfoService = $governmentInfoService;
    }

    public function index()
    {
        $param = [];

        $data = $this->governmentInfoService->getList($param);

        return $this->response->success($data);
    }

    public function show($id)
    {
        if (!$id) {
            throw new ValidationException('缺失参数');
        }

        $result = $this->governmentInfoService->getInfo($id);

        return $this->response->success($result);
    }
}
